When detecting an attachment of a peripheral device (using a universal serial bus (USB) interface or a headset interface), a portable terminal performs a relevant operation such as electric charge while outputting a detection sound.
However, such a user interface (UI) representing a command/sound that is displayed/outputted when a peripheral device is attached to or detached from a portable terminal is too simple and is not intuitive because the UI is a simple command/sound output indicating the attachment or detachment.